//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
/*
 * gpio-pxa.S - gpio setup for PXA architecture
 *
 * $Id: gpio.S,v 1.1 2006/10/19 03:20:17 zhangyi Exp $
 *
 * Copyright (C) 2003 Abraham van der Merwe <abz@4dllc.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <arch.h>

.text

.globl gpiosetup
gpiosetup:
	@ GPIO41, 42, 43, 44, 45, 46, 47, 48
	ldr             r0, =0x40E10438 @ GPIO41 FFRXD
	ldr             r1, =0x802
	str             r1, [r0]

	ldr             r0, =0x40E1043C @ GPIO42 FFTXD
	ldr             r1, =0x802
	str             r1, [r0]

	ldr             r0, =0x40E10440 @ GPIO43 FFCTS
	ldr             r1, =0x802
	str             r1, [r0]

	ldr             r0, =0x40E10444 @ GPIO 44 FFDCD
	ldr             r1, =0x802
	str             r1, [r0]

	ldr             r0, =0x40E10448 @ GPIO 45 FFDSR
	ldr             r1, =0x802
	str             r1, [r0]

	ldr             r0, =0x40E1044C @ GPIO 46 FFRI
	ldr             r1, =0x802
	str             r1, [r0]

	ldr             r0, =0x40E10450 @ GPIO 47 FFDTR
	ldr             r1, =0x802
	str             r1, [r0]

	ldr             r0, =0x40E10454 @ GPIO 48
	ldr             r1, =0x802
	str             r1, [r0]

        /* tebrandt - ASCR, clear the RDH bit */
        ldr             r0, =ASCR
        ldr             r1, [r0]
        bic             r1, r1, #0x80000000
        str             r1, [r0]

	mov		pc, lr
